﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:OMANE.Modules.PMT" x:Class="ViewIFichierPMT" 
             mc:Ignorable="d" d:DesignWidth="240" d:DesignHeight="48">
	<UserControl.Resources>
		<local:BoolToVisibilityInvConverter x:Key="BoolToVisibilityInvConverter"/>
		<local:TableStateToIconConverter x:Key="TableStateToIconConverter"/>
	</UserControl.Resources>
	<d:UserControl.DataContext>
		<local:ViewModelDirectoryPMT/>
	</d:UserControl.DataContext>
    <Grid VerticalAlignment="Top">
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition/>
    		<ColumnDefinition Width="Auto"/>
    	</Grid.ColumnDefinitions>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="25"/>
    		<RowDefinition Height="25"/>
    	</Grid.RowDefinitions>
    	<TextBlock HorizontalAlignment="Left" Margin="1,0,0,0" TextWrapping="Wrap" Text="{Binding DisplayName, Mode=OneWay}" FontWeight="Bold" VerticalAlignment="Center" d:LayoutOverrides="HorizontalAlignment"/>
    	<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="1">
    		<Image Width="16" Height="16" Margin="0" Source="{Binding Exists, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}"/>
    		<Button Content="Créer" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5,0,0,0" Visibility="{Binding Exists, Converter={StaticResource BoolToVisibilityInvConverter}, Mode=OneWay}" Command="{Binding CreerAction, Mode=OneWay}"/>
    		<Button Content="Modifier" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5,0,0,0" Command="{Binding ModifierAction, Mode=OneWay}"/>
    	</StackPanel>
    	<Border BorderBrush="Black" BorderThickness="1" Grid.Row="1" Grid.ColumnSpan="2">
    		<TextBlock TextWrapping="Wrap" Text="{Binding FullName, Mode=OneWay}" VerticalAlignment="Center" Margin="1,0,0,0" HorizontalAlignment="Left"/>
    	</Border>
            
    </Grid>
</UserControl>
